package com.IO流.处理流.BufferedWriter__缓冲流;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class BufferedWriter__ {
    public static void main(String[] args) throws IOException {
        String filepath = "D:\\JAVA_test\\bufferedWriter01.txt";
        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(filepath));
        /// 当前是不换行直接放到后面写
        bufferedWriter.write("hello1,haha");
        bufferedWriter.write("hello2,haha");
        bufferedWriter.write("hello3,haha");
        /// 当前是换行  bufferedWriter.newLine();

        bufferedWriter.newLine();   ///换行
        bufferedWriter.write("hello4,haha");
        bufferedWriter.newLine();   ///换行操作
        bufferedWriter.write("hello5,haha");
        bufferedWriter.newLine();
        bufferedWriter.write("hello6,haha");

        bufferedWriter.close();
    }
}
